<template>
  <div class="recommend-card__module">
    <div class="card-box">
      <div class="pic-box">
        <div class="pic">
          <mivaLink>
            <!-- <el-image fit="cover" :src="cover" /> -->
            <img :src="cover" />
            <span class="item-mask-video" />
            <!-- <span class="item-duration">02:41</span> -->
            <span/>
          </mivaLink>
        </div>
      </div>
      <div class="item-info">
        <mivaLink class="item-title">{{title}}</mivaLink>
        <div class="item-count up">
          <mivaLink>{{nickname}}</mivaLink>
        </div>
        <div class="item-count">{{hit}} 点击 · {{rpcount}} 评论</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    props: {
        archive: {
            type: Object,
            default: () => ({}),
        },
    },
    computed: {
        cover() {
            return this.archive.cover || '//miva-unmcc.oss-cn-beijing.aliyuncs.com/timg.jpg';
        },
        title() {
            return this.archive.title || '标题';
        },
        nickname() {
            return this.archive.nickname || '九条米法';
        },
        hit() {
            return this.archive.hit || 0;
        },
        rpcount() {
            return this.archive.rpcount || 0;
        },
        mark() {
            return this.archive.mark || '';
        },
    },
};
</script>

<style lang="less">
.recommend-card__module {
  padding: 6px 0;
  .card-box {
    display: flex;
    .item-mask-video {
      opacity: 0;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.2);
      transition: opacity 0.3s;
      pointer-events: none;
    }
    .item-duration {
      opacity: 0;
      position: absolute;
      bottom: 2px;
      left: 6px;
      color: #fff;
      height: 12px;
      line-height: 12px;
      padding: 0 5px 1px 0;
      transition: all 0.3s;
      z-index: 5;
    }
    .pic-box {
      .pic {
        width: 141px;
        height: 80px;
        position: relative;
        overflow: hidden;
        border-radius: 2px;
      }
      &:hover {
        .item-mask-video {
          opacity: 1;
        }
        .item-duration {
          opacity: 1;
        }
      }
    }
    .item-info {
      margin-left: 10px;
      flex: 1;
      .item-title {
        height: 36px;
        line-height: 18px;
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
      }
      .item-count {
        display: inline-block;
        height: 16px;
        width: 100%;
        color: #999;
        font-size: 12px;
        a {
          color: #999;
        }
      }
      .up {
        width: 160px;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
}
</style>
